Goal:

Questions:

What does it mean to be correlated?

Background

Experiment

I created a simulation study to observe the co-evolutionary outcome of the newt-snake interaction with different genetic architectures (GAs) in a spatial setting. I hypothesized that we would see an interaction (co-evolutionary arms race) between newt and snake phenotype under some GA combinations when newts and snakes were evolving over geographical space. Each GA is paired with another GA creating 16 combinations.

Experiment values:

The data

many of the experiments did not run to completion (i will run this part 3 times)

## All cor, lit, and grid files exist!
## This program will now end!
## All cor, lit, and grid files exist!
## This program will now end!
## All cor, lit, and grid files exist!
## This program will now end!
## All cor, lit, and grid files exist!
## This program will now end!

Mean Phenotype Whole Simulation

Phenotype differences (mu_a)

Table of average Differences (mu_a)

##                      Group.1          x
## 1    1e-08_0.005_1e-08_0.005  0.1992955
## 2   1e-08_0.005_1e-08_0.0158 -2.6190220
## 3     1e-08_0.005_1e-08_0.05 -2.6620819
## 4    1e-08_0.005_1e-08_0.158 -0.4505283
## 5   1e-08_0.0158_1e-08_0.005  2.2320365
## 6  1e-08_0.0158_1e-08_0.0158 -0.3669443
## 7    1e-08_0.0158_1e-08_0.05 -0.3728984
## 8   1e-08_0.0158_1e-08_0.158  0.9724918
## 9     1e-08_0.05_1e-08_0.005  1.9839313
## 10   1e-08_0.05_1e-08_0.0158  0.3422434
## 11     1e-08_0.05_1e-08_0.05 -0.5473016
## 12    1e-08_0.05_1e-08_0.158  1.0134809
## 13   1e-08_0.158_1e-08_0.005 -0.4912139
## 14  1e-08_0.158_1e-08_0.0158 -1.7300389
## 15    1e-08_0.158_1e-08_0.05 -1.7856156
## 16   1e-08_0.158_1e-08_0.158 -0.4883829

Phenotype differences (mu_b)

Table of average Differences (mu_b)

##                      Group.1          x
## 1  1e-09_0.0158_1e-09_0.0158 -0.1800514
## 2    1e-09_0.0158_1e-09_0.05 -2.7872507
## 3   1e-09_0.0158_1e-09_0.158 -2.6596557
## 4     1e-09_0.0158_1e-09_0.5 -0.2624484
## 5    1e-09_0.05_1e-09_0.0158  2.1565001
## 6      1e-09_0.05_1e-09_0.05 -1.0227226
## 7     1e-09_0.05_1e-09_0.158 -0.5651596
## 8       1e-09_0.05_1e-09_0.5  0.9275661
## 9   1e-09_0.158_1e-09_0.0158  1.9144159
## 10    1e-09_0.158_1e-09_0.05  0.1618433
## 11   1e-09_0.158_1e-09_0.158 -0.3486149
## 12     1e-09_0.158_1e-09_0.5  0.3953932
## 13    1e-09_0.5_1e-09_0.0158 -0.1575938
## 14      1e-09_0.5_1e-09_0.05 -1.5405765
## 15     1e-09_0.5_1e-09_0.158 -2.4258750
## 16       1e-09_0.5_1e-09_0.5 -0.4065312

Phenotype differences (mu_c)

Table of average Differences (mu_c)

##                    Group.1          x
## 1    1e-10_0.05_1e-10_0.05 -0.1770372
## 2   1e-10_0.05_1e-10_0.158 -2.0700074
## 3     1e-10_0.05_1e-10_0.5 -2.8201207
## 4    1e-10_0.05_1e-10_1.58 -0.2513535
## 5   1e-10_0.158_1e-10_0.05  1.1371618
## 6  1e-10_0.158_1e-10_0.158 -0.7891382
## 7    1e-10_0.158_1e-10_0.5 -0.5400865
## 8   1e-10_0.158_1e-10_1.58  0.5548089
## 9     1e-10_0.5_1e-10_0.05  2.1550108
## 10   1e-10_0.5_1e-10_0.158  0.1827167
## 11     1e-10_0.5_1e-10_0.5 -0.4982388
## 12    1e-10_0.5_1e-10_1.58  0.9412633
## 13   1e-10_1.58_1e-10_0.05 -0.1096735
## 14  1e-10_1.58_1e-10_0.158 -1.9261740
## 15    1e-10_1.58_1e-10_0.5 -1.6721153
## 16   1e-10_1.58_1e-10_1.58 -0.4772448

Phenotype differences (mu_d)

Table of average Differences (mu_d)

##                    Group.1          x
## 1  1e-11_0.158_1e-11_0.158 -0.1057410
## 2    1e-11_0.158_1e-11_0.5 -2.9570047
## 3   1e-11_0.158_1e-11_1.58 -2.7859116
## 4      1e-11_0.158_1e-11_5 -0.8810266
## 5    1e-11_0.5_1e-11_0.158  2.3510041
## 6      1e-11_0.5_1e-11_0.5 -1.1395452
## 7     1e-11_0.5_1e-11_1.58 -1.3927014
## 8        1e-11_0.5_1e-11_5  0.5726998
## 9   1e-11_1.58_1e-11_0.158  1.9934883
## 10    1e-11_1.58_1e-11_0.5  0.2100988
## 11   1e-11_1.58_1e-11_1.58 -0.5771448
## 12      1e-11_1.58_1e-11_5  0.8917102
## 13     1e-11_5_1e-11_0.158 -0.3218156
## 14       1e-11_5_1e-11_0.5 -1.4110581
## 15      1e-11_5_1e-11_1.58 -1.7163337
## 16         1e-11_5_1e-11_5 -0.5156700

Connection between higher phenotype and population

Phenotype differences (mu_a)

Phenotype & Populationsize differences (mu_a)

Phenotype differences (mu_b)

Phenotype & Populationsize differences (mu_b)

Phenotype differences (mu_c)

Phenotype & Populationsize differences (mu_c)

Phenotype differences (mu_d)

Phenotype & Populationsize differences (mu_d)

Correlation

cor (mu_a)

cor (mu_b)

cor (mu_c)

cor (mu_d)

Correlation Histograms Mu A

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

Correlation Histograms Mu B

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

Correlation Histograms Mu C

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

Correlation Histograms Mu D

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

Correlation across time (mu_a)

Random 1 (mu_a)

## [1] "pattern 1e-08_0.05_1e-08_0.0158_0"
## [1] "Cor between average snake pheno and local cor -0.0487295109133277"
## [1] "Cor between average newt pheno and local cor -0.1028932633414"
## [1] "Cor between average dif pheno and local cor -0.00198415778544305"
## [1] "Cor between newt pheno and snake 0.255652514259803"

Random 2 (mu_a)

## [1] "pattern 1e-08_0.0158_1e-08_0.05_1"
## [1] "Cor between average snake pheno and local cor -0.324504127808386"
## [1] "Cor between average newt pheno and local cor -0.308456679352745"
## [1] "Cor between average dif pheno and local cor -0.198757708113736"
## [1] "Cor between newt pheno and snake 0.875698572728208"

Random 3 (mu_a)

## [1] "pattern 1e-08_0.158_1e-08_0.158_2"
## [1] "Cor between average snake pheno and local cor 0.274033580777475"
## [1] "Cor between average newt pheno and local cor 0.0652153058093514"
## [1] "Cor between average dif pheno and local cor 0.135235166833201"
## [1] "Cor between newt pheno and snake 0.502705574834288"

Correlation across time (mu_b)

Random 1 (mu_b)

## [1] "pattern 1e-09_0.5_1e-09_0.158_3"
## [1] "Cor between average snake pheno and local cor -0.188577849750241"
## [1] "Cor between average newt pheno and local cor 0.169856208070537"
## [1] "Cor between average dif pheno and local cor -0.179490600465048"
## [1] "Cor between newt pheno and snake -0.529585802991612"

Random 2 (mu_b)

## [1] "pattern 1e-09_0.5_1e-09_0.05_3"
## [1] "Cor between average snake pheno and local cor -0.0208754885081981"
## [1] "Cor between average newt pheno and local cor -0.0392539337864685"
## [1] "Cor between average dif pheno and local cor 0.051843636001524"
## [1] "Cor between newt pheno and snake 0.907925860795211"

Random 3 (mu_b)

## [1] "pattern 1e-09_0.05_1e-09_0.0158_1"
## [1] "Cor between average snake pheno and local cor 0.24739221452579"
## [1] "Cor between average newt pheno and local cor 0.212570004584453"
## [1] "Cor between average dif pheno and local cor 0.2484570758183"
## [1] "Cor between newt pheno and snake 0.901108008074452"

Correlation across time (mu_c)

Random 1 (mu_c)

## [1] "pattern 1e-10_0.5_1e-10_1.58_3"
## [1] "Cor between average snake pheno and local cor -0.121418541655818"
## [1] "Cor between average newt pheno and local cor -0.157102106815451"
## [1] "Cor between average dif pheno and local cor 0.126618903800452"
## [1] "Cor between newt pheno and snake 0.808239262081312"

Random 2 (mu_c)

## [1] "pattern 1e-10_0.05_1e-10_0.05_1"
## [1] "Cor between average snake pheno and local cor 0.309322859618352"
## [1] "Cor between average newt pheno and local cor 0.24121178437586"
## [1] "Cor between average dif pheno and local cor -0.166108372861542"
## [1] "Cor between newt pheno and snake 0.79328492583728"

Random 3 (mu_c)

## [1] "pattern 1e-10_0.05_1e-10_0.5_2"
## [1] "Cor between average snake pheno and local cor -0.218259822165505"
## [1] "Cor between average newt pheno and local cor -0.0385018391201607"
## [1] "Cor between average dif pheno and local cor 0.00428044337768038"
## [1] "Cor between newt pheno and snake 0.394594901159412"

Correlation across time (mu_d)

Random 1 (mu_d)

## [1] "pattern 1e-11_5_1e-11_0.158_3"
## [1] "Cor between average snake pheno and local cor -0.414942257672583"
## [1] "Cor between average newt pheno and local cor 0.0277011906708567"
## [1] "Cor between average dif pheno and local cor -0.434026603707357"
## [1] "Cor between newt pheno and snake 0.395152084813007"

Random 2 (mu_d)

## [1] "pattern 1e-11_0.158_1e-11_1.58_0"
## [1] "Cor between average snake pheno and local cor 0.0735034394238854"
## [1] "Cor between average newt pheno and local cor 0.195715595275058"
## [1] "Cor between average dif pheno and local cor -0.201914700321686"
## [1] "Cor between newt pheno and snake 0.709811710982185"

Random 3 (mu_d)

## [1] "pattern 1e-11_0.5_1e-11_1.58_3"
## [1] "Cor between average snake pheno and local cor 0.0607985291507229"
## [1] "Cor between average newt pheno and local cor 0.111174918178782"
## [1] "Cor between average dif pheno and local cor -0.00167702288842655"
## [1] "Cor between newt pheno and snake 0.92717040867036"

What happens over time (looking at the beginning, middle, and late part of my simulations) (mu_a)

Pheno Beginning (mu_a)

Pheno Middle (mu_a)

Pheno End (mu_a)

Dif Beginning (mu_a)

Dif Middle (mu_a)

Dif End (mu_a)

What happens over time (looking at the beginning, middle, and late part of my simulations) (mu_b)

Pheno Beginning (mu_b)

Pheno Middle (mu_b)

Pheno End (mu_b)

Dif Beginning (mu_b)

Dif Middle (mu_b)

Dif End (mu_b)

What happens over time (looking at the beginning, middle, and late part of my simulations) (mu_c)

Pheno Beginning (mu_c)

Pheno Middle (mu_c)

Pheno End (mu_c)

Dif Beginning (mu_c)

Dif Middle (mu_c)

Dif End (mu_c)

What happens over time (looking at the beginning, middle, and late part of my simulations) (mu_d)

Pheno Beginning (mu_d)

Pheno Middle (mu_d)

Pheno End (mu_d)

Dif Beginning (mu_d)

Dif Middle (mu_d)

Dif End (mu_d)

Summary (mu_a)

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

Summary (mu_b)

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

Summary (mu_c)

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

Summary (mu_d)

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

Heatmap (mu_a)

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

Heatmap (mu_b)

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

Heatmap (mu_c)

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

Heatmap (mu_d)

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

What is up with the correlations

Early Simulation Correlation (mu_a)

Mean

## [1] 0.175967

Max

## [1] 0.0332757

Min

## [1] 0.3835646

popsize

## [1] 0.4571865

Early Simulation Correlation (mu_b)

Mean

## [1] 0.09721275

Max

## [1] 0.2512714

Min

## [1] -0.0413653

popsize

## [1] 0.3734398

Early Simulation Correlation (mu_c)

Mean

## [1] -0.03357724

Max

## [1] -0.002025376

Min

## [1] -0.06447409

popsize

## [1] 0.4621257

Early Simulation Correlation (mu_d)

Mean

## [1] -0.08069088

Max

## [1] -0.01528845

Min

## [1] 0.194037

popsize

## [1] 0.4058892

Late Simulation Correlation (mu_a)

Mean

## [1] -0.01161515

Max

## [1] 0.003841763

Min

## [1] 0.1921011

Pop size

## [1] 0.4572612

Late Simulation Correlation (mu_b)

Mean

## [1] -0.2412117

Max

## [1] 0.05418303

Min

## [1] -0.07366725

Pop size

## [1] 0.4547376

Late Simulation Correlation (mu_c)

Mean

## [1] 0.1976847

Max

## [1] 0.1045342

Min

## [1] 0.3865767

Pop size

## [1] 0.3459803

Late Simulation Correlation (mu_d)

Mean

## [1] 0.4420563

Max

## [1] 0.4327811

Min

## [1] 0.4404188

Pop size

## [1] 0.4507497